[20250204] BOJ / 플레3 / A Journey to Greece / 권혁준 #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/10849
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
정점$N$ 개인 그래프에서, 제한시간 내에 시작점 $0$ 으로부터 특정 지점 $P$ 개를 모두 들렀다가 다시 $0$ 으로 돌아오는 게 가능한지 판별$T$ 소모할 수 있음
중간에 딱 한 번, 택시를 타고 아무 곳이나 갈 수 있는 대신 시간
🔍 풀이 방법
다익스트라$P$ 번 돌려서 $P$ 개 정점만으로 이루어진 그래프를 새로 만들기
이 그래프에서 TSP 돌리기
택시를 탄 경우랑 타지 않은 경우 두 가지 DP를 모두 계산해줘야 함.
⏳ 회고
옛날에 못 풀었던 문제인데, 성장한 느낌이 든다.